<template>
  <div class="page-search">
    <binQueryForm :formConfig="formConfig">
      <template #btnFunction>
        <div>
          <span class="span">接收者: </span>
          <el-radio-group v-model="subscriber" @change="handleRadioChange" >
            <el-radio-button :label="3" border>所有人</el-radio-button>
            <el-radio-button :label="0" border>管理员</el-radio-button>
            <el-radio-button :label="1" border>教师</el-radio-button>
            <el-radio-button :label="2" border>学生</el-radio-button>
          </el-radio-group>
        </div>
      </template>
    </binQueryForm>
  </div>
</template>

<script setup>
import binQueryForm from '@/base-ui/queryForm'
import { defineProps, ref } from 'vue'
import { useRoute } from 'vue-router'
import { binMsg } from '@/global/api.js'

const props = defineProps({
  formConfig: {
    type: Object,
    default: {}
  },
  subscriber: {
    type: Number,
    required: true
  }
})
// const radioValue = ref('3')

const emit = defineEmits(['update:subscriber'])

// 点击单选框，发出事件给父组件
const handleRadioChange = (data) => {
  emit('update:subscriber', data)
}
</script>

<style lang="less" scoped>
.span {
  vertical-align: -webkit-baseline-middle;
  font-size: 18px;
  margin-left: 10px;
  margin-right: 15px;
  // font-weight: 700;
}
</style>
